package com.xw.roomWeb;


import java.util.Properties;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

import com.google.code.kaptcha.impl.DefaultKaptcha;
import com.google.code.kaptcha.util.Config;


@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableFeignClients
public class Application{
	public static void main(String[] args) {
		SpringApplication.run(Application.class, args);
	}
	@Bean
	public DefaultKaptcha defaultKaptcha() {
		DefaultKaptcha captcha = new DefaultKaptcha();
		Properties properties = new Properties();
		properties.put("kaptcha.border", "no");
		properties.put("kaptcha.border.color", "255,255,255");
		properties.put("kaptcha.noise.color", "white");
		properties.put("kaptcha.textproducer.char.string", "0123456789");
		properties.put("kaptcha.textproducer.font.color", "78,131,211");
		properties.put("kaptcha.image.width", "230");
		properties.put("kaptcha.textproducer.font.size", "90");
		properties.put("kaptcha.image.height", "100");
		properties.put("kaptcha.textproducer.char.length", "4");
		properties.put("kaptcha.textproducer.font.names", "正楷");
		properties.put("kaptcha.background.clear.from", "white");
		properties.put("kaptcha.background.clear.to", "white");
		Config config = new Config(properties);
		captcha.setConfig(config);
		return captcha;

	}
}
